package com.eaoa.uc.pubmessage.form;

import org.apache.commons.lang.StringUtils;

import com.eaoa.base.EABaseForm;
import com.eaoa.vo.pub.PubMessage;
import com.stony.core.util.CoreUtils;

public class MessageForm extends EABaseForm {

	private String messageno;
	private String subject;
	private String content;
	private String sender;
	private String sendername;
	private String senderdate;
	private String receivers;
	private String receivername;
	private String status;
	private String islock;
	private String directcommit;
	private String messagetype;
	private String sessionid;

	public PubMessage getVO() {

		PubMessage vo = new PubMessage();

		if (StringUtils.isNotBlank(this.messageno))
			vo.setMessageno(new Long(this.getMessageno()));
		if (StringUtils.isNotBlank(this.sessionid))
			vo.setSessionid(new Long(this.getSessionid()));
		vo.setSubject(this.getSubject());
		vo.setContent(this.getContent());
		vo.setReceivers(this.getReceivers());
		vo.setReceivername(this.getReceivername());
		vo.setStatus(this.getStatus());
		vo.setIslock(this.getIslock());
		vo.setMessagetype(this.getMessagetype());
		
		return vo;
	}

	public void setVO(PubMessage vo) {

		this.setMessageno(CoreUtils.formatString(vo.getMessageno()));
		this.setSessionid(CoreUtils.formatString(vo.getSessionid()));
		this.setSubject(CoreUtils.formatString(vo.getSubject()));
		this.setContent(CoreUtils.formatString(vo.getContent()));
		this.setReceivers(vo.getReceivers());
		this.setReceivername(vo.getReceivername());
		this.setStatus(CoreUtils.formatString(vo.getStatus()));
		this.setIslock(CoreUtils.formatString(vo.getIslock()));
		this.setMessagetype(vo.getMessagetype());
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getIslock() {
		return islock;
	}

	public void setIslock(String islock) {
		this.islock = islock;
	}

	public String getMessageno() {
		return messageno;
	}

	public void setMessageno(String messageno) {
		this.messageno = messageno;
	}

	public String getReceivers() {
		return receivers;
	}

	public void setReceivers(String receivers) {
		this.receivers = receivers;
	}

	public String getReceivername() {
		return receivername;
	}

	public void setReceivername(String receivername) {
		this.receivername = receivername;
	}

	public String getSender() {
		return sender;
	}

	public void setSender(String sender) {
		this.sender = sender;
	}

	public String getSenderdate() {
		return senderdate;
	}

	public void setSenderdate(String senderdate) {
		this.senderdate = senderdate;
	}

	public String getSendername() {
		return sendername;
	}

	public void setSendername(String sendername) {
		this.sendername = sendername;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getDirectcommit() {
		return directcommit;
	}

	public void setDirectcommit(String directcommit) {
		this.directcommit = directcommit;
	}

	public String getMessagetype() {
		return messagetype;
	}

	public void setMessagetype(String messagetype) {
		this.messagetype = messagetype;
	}

	public String getSessionid() {
		return sessionid;
	}

	public void setSessionid(String sessionid) {
		this.sessionid = sessionid;
	}

}
